package com.hhit.bigscreenbackmanage.controller.tgygl;

import com.alibaba.fastjson.JSONObject;
import com.hhit.bigscreenbackmanage.common.Response;
import com.hhit.bigscreenbackmanage.entity.tgygl.TTgyglLicenseProcessing;
import com.hhit.bigscreenbackmanage.service.tgygl.TTgyglLicenseProcessingService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/tgygl/licenseProcessing")
public class LicenseProcessingController {

    private Logger log = LoggerFactory.getLogger(LicenseProcessingController.class);

    @Autowired
    TTgyglLicenseProcessingService tTgyglLicenseProcessingService;

    /**
     * 查询 属地公司政处及证照办理情况统计数据
     * @param jsonObject
     * @return
     */
    @RequestMapping("/getLicenseProcessingCount")
    public Response getLicenseProcessingCount(@RequestBody JSONObject jsonObject){
        try{
            List<Map<String, Object>> result = tTgyglLicenseProcessingService.queryLicenseProcessingCount(jsonObject);
            return Response.createResponseBySuccess("查询属地公司政处及证照办理情况统计数据成功",result);
        }catch (Exception e){
            log.error("查询属地公司政处及证照办理情况统计数据失败: " + e.getMessage());
            return Response.createResponseByError("查询属地公司政处及证照办理情况统计数据失败");
        }
    }

}
